<%inherit file="/base/index.html" />

<%def name="heading()">
    <h1 class="heading">Application Settings</h1>
</%def>

<p>This page lists the system-wide settings of the application.  Only \
administrators should be permitted to alter these settings.</p>

% if 'user_role' in session and session['user_role'] == 'administrator':
<a href="${url(controller='settings', action='edit')}" class="buttonLink" \
   title="Edit the application-wide settings">edit</a>
% endif

<h1 class="heading margintop">Object Language</h1>

<table class="infoTable">
    <tr>
     <td>
      Name
      <p class="explanation">The name of the language under study.</p>
     </td>
     <td>
      ${getattr(c.applicationSettings, 'objectLanguageName', 'unspecified')}
      % if hasattr(c.applicationSettings, 'objectLanguageId') and \
      c.applicationSettings.objectLanguageId:
       <p class="explanation">ISO 639-3 ID: \
       ${c.applicationSettings.objectLanguageId}</p>
      % endif
     </td>
    </tr>
</table>

<h1 class="heading margintop">Storage, Input &amp; Output</h1>

<table class="infoTable margintop">
    <tr>
     <td>
      Object Language Storage Orthography
      <p class="explanation">The orthography used to store object language \
      strings.</p>
      <p class="explanation">All object language input will be converted from
      the input orthography to the storage orthography for storage in the
      database.  Similarly, all object language output will be converted from
      the storage orthography to the output orthography.</p>
      <p class="explanation">The storage orthography should be set when the OLD
      application is first set up and not changed thereafter.</p>
     </td>
     <td>${c.OLOrthographies[c.applicationSettings.storageOrthography][0]}</td>
    </tr>

    <tr>
     <td>
      Object Language Default Input Orthography
      <p class="explanation">The orthography that this OLD application expects \
      object language data to be entered in.  This is the system-wide default, \
      but each user has the option of choosing an alternate input orthography \
      for themselves.</p>
      
      % if c.OLOrthographies[c.applicationSettings.defaultInputOrthography][0] \
      != c.OLOrthographies[c.applicationSettings.storageOrthography][0]:
      
      <p class="explanation required">Note: this system's default behaviour will
      be to treat object language input as
      ${c.OLOrthographies[c.applicationSettings.defaultInputOrthography][0]}
      and to attempt to convert it into
      ${c.OLOrthographies[c.applicationSettings.storageOrthography][0]} for
      storage.</p>
      
      % endif
      
     </td>
     <td>${c.OLOrthographies[c.applicationSettings.defaultInputOrthography][0]}
     </td>
    </tr>
    
    <tr>
     <td>
      Object Language Default Output Orthography
      <p class="explanation">The orthography that this OLD application uses to \
      display object language strings.  This is the system-wide default, but \
      each user has the option of choosing an alternate output orthography for \
      themselves.</p>
      
      % if c.OLOrthographies[c.applicationSettings.defaultOutputOrthography][0] \
      != c.OLOrthographies[c.applicationSettings.storageOrthography][0]:
      
      <p class="explanation required">Note: this system's default behaviour will
      be to treat stored object language data as
      ${c.OLOrthographies[c.applicationSettings.storageOrthography][0]}
      and to attempt to convert it into
      ${c.OLOrthographies[c.applicationSettings.defaultOutputOrthography][0]}
      for display.</p>
      
      % endif
      
     </td>
     <td>${c.OLOrthographies[c.applicationSettings.defaultOutputOrthography][0]}
     </td>
    </tr>
</table>

<a href="${url(controller='settings', action='orthography')}" class="buttonLink" \
   title="More about object language orthographies">More on Orthographies ...</a>

<h1 class="heading margintop">Object Language Orthography(/ies)</h1>

<table class="infoTable">
    % for key in c.OLOrthographies:
    % if c.OLOrthographies[key][0] and c.OLOrthographies[key][1]:
    <tr>
     <td>
      ${c.OLOrthographies[key][0]}
      <p class="explanation">
        An orthography for entering object language strings.
      </p>
     </td>
     <td>
      ${c.OLOrthographies[key][1]}
     </td>
    </tr>
    % endif
    % endfor
</table>

<h1 class="heading margintop">Object Language Strings</h1>

<table class="infoTable">
    
    <tr>
     <td>
      Pure Object Language Fields
      <p class="explanation">The system assumes that these fields contain
      nothing but strings of the object language.  The data in these fields may
      be converted from one orthography to another depending on system-wide and
      user-specific settings.
      </p>
     </td>
     <td>
      <ul>
        <li>Form transcriptions</li>
        % if c.applicationSettings.morphemeBreakIsObjectLanguageString == u'yes':
        <li>Form morpheme breaks</li>
        % endif
      </ul>
     </td>
    </tr>

    <tr>
     <td>
      Partial Object Language Fields
      <p class="explanation">The system assumes that these fields may contain
      substrings enclosed in object language tags ('&lt;obl&gt;' to the left and
      '&lt;/obl&gt;' to the right) and that these substrings are strings of the object
      language.  These substrings may be converted from one orthography to
      another depending on system-wide and user-specific settings.
      </p>
     </td>
     <td>
      <ul>
        <li>Form general comments</li>
        <li>Form speaker comments</li>
      </ul>
     </td>
    </tr>
    
</table>

<h1 class="heading margintop">Metalanguage</h1>

<table class="infoTable">
    <tr>
     <td>
      Metalanguage
      <p class="explanation">language used in the glossing and analysis of the \
      object language</p>
     </td>
     <td>
      ${getattr(c.applicationSettings, 'metaLanguageName', 'unspecified')}
      % if hasattr(c.applicationSettings, 'metaLanguageId'):
       <p class="explanation">ISO 639-3 ID: \
       ${c.applicationSettings.metaLanguageId}</p>
      % endif
     </td>
    </tr>
    
    <tr>
     <td>
      Metalanguage Orthography
      <p class="explanation">graphs of the metalanguage</p>
     </td>
     <td>
        ${c.MLOrthographyTable}
     </td>
    </tr>
</table>

<h1 class="heading margintop">Appearance</h1>

<table class="infoTable">    
    <tr>
     <td>
      Header Image
      <p class="explanation">name of a File to use in the header/banner of the \
      application</p>
     </td>
     <td>
        % if c.applicationSettings.headerImageName:
            ${c.applicationSettings.headerImageName}
        % else:
            unspecified
        % endif
     </td>
    </tr>

    <tr>
     <td>
      CSS Colors
      <p class="explanation">choose a CSS file for the color scheme of the \
      application</p>
     </td>
     <td>
        % if c.applicationSettings.colorsCSS:
            ${c.applicationSettings.colorsCSS}
        % else:
            unspecified
        % endif
     </td>
    </tr>
</table>

<h1 class="heading margintop">Database</h1>

<table class="infoTable">
    <tr>
     <td>
      RDBMS
      <p class="explanation">type of RDBMS (relational database management \
      system) being used.
      </p>
     </td>
     <td>${c.rdbms}</td>
    </tr>
    
    <tr>
     <td>
      Database Name
      <p class="explanation">name of RDBMS database being used.</p>
     </td>
     <td>${c.databaseName}</td>
    </tr>
</table>

% if 'user_role' in session and session['user_role'] == 'administrator':
<a href="${url(controller='settings', action='edit')}" class="buttonLink" \
   title="Edit the application-wide settings">edit</a>
% endif